/*
 * @Encoding:
 * @Descripttion:
 * @Author: Y2014188432
 * @Date: 2022-04-25 19:15:57
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import User from '../views/User.vue'
import elementUiTest from "../views/elementUiTest";
import Test from "../views/Test";
import Login from "../views/Login";
import Master from "../views/Master";
import aside from "../components/aside";
import MyAside from "../components/MyAside";
import Demo from "../components/Demo";
import ele1 from "../components/ele1";
import UserMessage from "../views/UserMessage";
import Plate from "../views/Plate";
import Posts from "../views/Posts";
import showMyPosts from "../views/showMyPosts";
import Admin from "../views/Admin";
import AllPlate from "../views/AllPlate";
Vue.use(VueRouter)

const routes = [
    {
        path:'/home',
        component:Home,
        redirect:'/hello',
        children:[{
            path:'/admin',
            component: () => import("../views/Admin")
        },
        {
            path:'/hello',
            component: () => import("../components/newPage/hello")
        },
        {
            path:'/plate',
            component: () => import("../components/newPage/showPlate")
        },
        {
            path:'/displayMyPost',
            component: () => import("../views/showMyPosts")
        },
        {
            path:'/userMessage',
            component:UserMessage
        },
        {
            path:'/posts',
            component:Posts
        },
        {
            path:'/search',
            component: () => import("../components/newPage/search")
        },
        {
            path:'/quit',
            component: () => import("../components/newPage/quit")
        },
        {
            path:'/allPlate',
            component: () => import("../views/AllPlate")
        }]
    },
    {
      path:'/allPlate',
        component:AllPlate
    },
    {
      path:'/test1',
      component:() => import("../components/newPage/win1")
    },


  {
    path: '/',
    component: Login
  },
    {
      path:'/testMenu',
      component: () => import("../components/user/menu")
    },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/user',
    component: User
  },
  {
    path: "/ele",
    component:elementUiTest
  },
  {
    path:'/test',
    component:Test
  },
  {
    path:'/login',
    component:Login
  },
  {
    path:'/master',
    component:Master
  },
  {
    path:'/aside',
    component:aside
  },
  {
    path:'/MyAside',
    component:MyAside
  },
  {
    path:'/demo',
    component:Demo
  },
  {
    path:'/ele1',
    component:ele1
  },



]

const router = new VueRouter({
  // mode: 'history',
  // base: process.env.BASE_URL,
  routes,
  mode:'history'
})

export default router
